package com.management.controller;


import com.management.controller.form.AddfeedbackForm;
import com.management.controller.form.GetcommentByDefectIdForm;
import com.management.service.CommentService;
import com.management.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author 龙世超
 * @since 2022-03-23
 */
@Api(tags = "反馈相关")
@RestController
@RequestMapping("/comment")
public class CommentController {

    @Resource
    private CommentService commentService;

    /**
     * 根据缺陷Id获取反馈
     * @param getcomment
     * @return
     */
    @ApiOperation("根据缺陷Id获取反馈")
    @PostMapping("/GetcommentByDefectId")
    public Result GetcommentByDefectId(@RequestBody GetcommentByDefectIdForm getcomment){
        return commentService.FindcommentByDefectId(getcomment);
    }

    /**
     *添加反馈
     * @param addfeedbackForm
     * @return
     */
    @ApiOperation("添加反馈")
    @PostMapping("/Addfeedback")
    public Result Addfeedback(@RequestBody AddfeedbackForm addfeedbackForm){
        return commentService.Addfeedback(addfeedbackForm);
    }
}

